<template>
  <div class="wrapper">
    <x-tabbar :tab-titles="tabTitles" 
        :tab-styles="tabStyles"
        title-type="iconFont" >
    <!-- 首页 -->
    <div class="item-container" :style="contentStyle">
      <home ref="homePage"></home>
    </div>
    <!-- 分类 -->
    <div class="item-container" :style="contentStyle">
      <convert ref="convert"></convert>
    </div>
    <!-- 领券 -->
    <div class="item-container" :style="contentStyle">
      
    </div>
    <!-- 我的 -->
    <div class="item-container" :style="contentStyle">
      
    </div>
  </x-tabbar>
  </div>
</template>

<script>
import asCore from "../../common/js/core";
import Utils from "../../common/js/utils";
import config from "../../configs/storeconfig";
var modal = weex.requireModule("modal");
const navigator = weex.requireModule("navigator");
export default {
  components: {
    "x-tabbar": require("../../common/component/tabbar.vue"),
    "home": require("./home.vue"),
    "convert":require("./convert.vue"),
  },
  created() {
    var _this = this;
    var globalEvent = weex.requireModule('globalEvent') ;
    globalEvent.addEventListener("onPageInit", function (e) {
      var param = navigator.param();
      param && (_this.storeData = param['data']);
      _this.$refs.homePage.set_storedata(_this.storeData);
      _this.$refs.homePage.loadMainData();
    });
    const tabPageHeight = Utils.env.getPageHeight();
    const { tabStyles } = this;
    this.contentStyle = { height: tabPageHeight + 25 + "px" };
  },
  data() {
    return {
      storeData:null,
      tabTitles: config.tabIconFontTitles,
      tabStyles: config.tabIconFontStyles
    };
  },
  methods: {
  }
};
</script>
<style scoped>
.wrapper {
  
}
.item-container {
  flex: 1;
  width: 750px;
  background-color: #dedfe1;
}
</style>
